<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>Class Slimore\Upload\Uploader | Slimore</title>

	<link rel="stylesheet" href="resources/bootstrap.min.css?973e37a8502921d56bc02bb55321f45b072b6f71">
	<link rel="stylesheet" href="resources/style.css?49f43d3208c5d7e33fa16d36107a345bf11cc00d">

</head>

<body>
	<nav id="navigation" class="navbar navbar-default navbar-fixed-top">
		<div class="container-fluid">
			<div class="navbar-header">
				<a href="index.html" class="navbar-brand">Slimore</a>
			</div>
			<div class="collapse navbar-collapse">

                <form id="search" class="navbar-form navbar-left" role="search">
                    <input type="hidden" name="cx" value="">
                    <input type="hidden" name="ie" value="UTF-8">
                    <div class="form-group">
                        <input type="text" name="q" class="search-query form-control" placeholder="Search">
					</div>
				</form>

				<ul class="nav navbar-nav">
					<li>
						<a href="namespace-Slimore.Upload.html" title="Summary of Slimore\Upload"><span>Namespace</span></a>
					</li>
					<li class="active">
<span>Class</span>					</li>





				</ul>
			</div>
		</div>
	</nav>

	<div id="left">
	<div id="menu">

		<div id="groups">
				<h3>Namespaces</h3>
			<ul>
					<li>
						<a href="namespace-None.html">
							None						</a>
							</li>
					<li class="active">
						<a href="namespace-Slimore.html">
							Slimore<span></span>
						</a>
							<ul>
					<li>
						<a href="namespace-Slimore.Cache.html">
							Cache<span></span>
						</a>
							<ul>
					<li>
						<a href="namespace-Slimore.Cache.Exception.html">
							Exception						</a>
							</li>
								</ul></li>
					<li>
						<a href="namespace-Slimore.Captcha.html">
							Captcha						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Database.html">
							Database						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Debug.html">
							Debug						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Http.html">
							Http						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Image.html">
							Image						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Log.html">
							Log						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Middleware.html">
							Middleware						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Mvc.html">
							Mvc						</a>
							</li>
					<li>
						<a href="namespace-Slimore.Pagination.html">
							Pagination						</a>
							</li>
					<li class="active">
						<a href="namespace-Slimore.Upload.html">
							Upload						</a>
							</li>
								</ul></li>
			</ul>
		</div>


		<div id="elements">
			<h3>Classes</h3>
			<ul>
				<li class="active"><a href="class-Slimore.Upload.Uploader.html">Uploader</a></li>
			</ul>



			<h3>Exceptions</h3>
			<ul>
				<li><a href="class-Slimore.Upload.Exception.html">Exception</a></li>
			</ul>


		</div>
	</div>
</div>

<div id="splitter"></div>

<div id="right">
	<div id="rightInner">
<div id="content" class="class">
	<h1>Class Uploader</h1>


	<div class="description">
	<p>Class Uploader</p>
	</div>









	<div class="alert alert-info">
		
		
		<b>Namespace:</b> <a href="namespace-Slimore.html">Slimore</a>\<a href="namespace-Slimore.Upload.html">Upload</a><br>
		<b>Package:</b> Slimore\Upload<br>

				<b>Author:</b>
				Pandao<br>
			<b>Located at</b> <a href="source-class-Slimore.Upload.Uploader.html#17-530" title="Go to source code">Slimore/Upload/Uploader.php</a>
		<br>
	</div>



		<div class="panel panel-default">
			<div class="panel-heading"><h2>Methods summary</h2></div>
			<table class="summary table table-bordered table-striped methods" id="methods">
		<tr data-order="__construct" id="___construct">

			<td class="attributes"><code>
				 public 
				viod
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#___construct">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#163-173" title="Go to source code">__construct</a>( <span>array <var>$configs</var></span> )</code>

			<div class="description short">
				<p>Constructor</p>
			</div>

			<div class="description detailed hidden">
				<p>Constructor</p>


					<h4>Parameters</h4>
					<div class="list"><dl>
						<dt><var>$configs</var></dt>
						<dd></dd>
					</dl></div>

					<h4>Returns</h4>
					<div class="list">
						viod
					</div>




			</div>
			</div></td>
		</tr>
		<tr data-order="config" id="_config">

			<td class="attributes"><code>
				 public 
				
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_config">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#176-192" title="Go to source code">config</a>( <span>array <var>$configs</var></span> )</code>

			<div class="description short">
				<p>Set configs</p>
			</div>

			<div class="description detailed hidden">
				<p>Set configs</p>


					<h4>Parameters</h4>
					<div class="list"><dl>
						<dt><var>$configs</var></dt>
						<dd></dd>
					</dl></div>





			</div>
			</div></td>
		</tr>
		<tr data-order="upload" id="_upload">

			<td class="attributes"><code>
				 public 
				boolean
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_upload">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#195-232" title="Go to source code">upload</a>( <span>string <var>$name</var></span> )</code>

			<div class="description short">
				<p>Execute upload</p>
			</div>

			<div class="description detailed hidden">
				<p>Execute upload</p>


					<h4>Parameters</h4>
					<div class="list"><dl>
						<dt><var>$name</var></dt>
						<dd>fileInput's name</dd>
					</dl></div>

					<h4>Returns</h4>
					<div class="list">
						boolean
					</div>




			</div>
			</div></td>
		</tr>
		<tr data-order="getSeveName" id="_getSeveName">

			<td class="attributes"><code>
				 public 
				string
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_getSeveName">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#395-404" title="Go to source code">getSeveName</a>( )</code>

			<div class="description short">
				<p>Get Saved filename for database</p>
			</div>

			<div class="description detailed hidden">
				<p>Get Saved filename for database</p>



					<h4>Returns</h4>
					<div class="list">
						string
					</div>




			</div>
			</div></td>
		</tr>
		<tr data-order="getFileExt" id="_getFileExt">

			<td class="attributes"><code>
				 public 
				string
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_getFileExt">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#407-417" title="Go to source code">getFileExt</a>( <span>string <var>$fileName</var></span> )</code>

			<div class="description short">
				<p>Get filename extension</p>
			</div>

			<div class="description detailed hidden">
				<p>Get filename extension</p>


					<h4>Parameters</h4>
					<div class="list"><dl>
						<dt><var>$fileName</var></dt>
						<dd></dd>
					</dl></div>

					<h4>Returns</h4>
					<div class="list">
						string
					</div>




			</div>
			</div></td>
		</tr>
		<tr data-order="redirect" id="_redirect">

			<td class="attributes"><code>
				 public 
				
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_redirect">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#420-429" title="Go to source code">redirect</a>( )</code>

			<div class="description short">
				<p>Redirect for Upload success, failure or error</p>
			</div>

			<div class="description detailed hidden">
				<p>Redirect for Upload success, failure or error</p>







			</div>
			</div></td>
		</tr>
		<tr data-order="message" id="_message">

			<td class="attributes"><code>
				 public 
				array|string
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_message">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#432-481" title="Go to source code">message</a>( <span>string <var>$message</var></span>, <span>integer <var>$success</var> = <span class="php-num">0</span></span>, <span>boolean <var>$return</var> = <span class="php-keyword1">false</span></span> )</code>

			<div class="description short">
				<p>Errors message handle</p>
			</div>

			<div class="description detailed hidden">
				<p>Errors message handle</p>


					<h4>Parameters</h4>
					<div class="list"><dl>
						<dt><var>$message</var></dt>
						<dd></dd>
						<dt><var>$success</var></dt>
						<dd></dd>
						<dt><var>$return</var></dt>
						<dd>false</dd>
					</dl></div>

					<h4>Returns</h4>
					<div class="list">
						array|string
					</div>




			</div>
			</div></td>
		</tr>
		<tr data-order="jsonHeader" id="_jsonHeader">

			<td class="attributes"><code>
				 public 
				
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_jsonHeader">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#484-492" title="Go to source code">jsonHeader</a>( )</code>

			<div class="description short">
				<p>Set JSON mime header</p>
			</div>

			<div class="description detailed hidden">
				<p>Set JSON mime header</p>







			</div>
			</div></td>
		</tr>
		<tr data-order="success" id="_success">

			<td class="attributes"><code>
				 public 
				array|string
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_success">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#495-505" title="Go to source code">success</a>( <span>string <var>$message</var> = <span class="php-quote">&quot;Upload successfully.&quot;</span></span>, <span>boolean <var>$return</var> = <span class="php-keyword1">false</span></span> )</code>

			<div class="description short">
				<p>Upload success message handle</p>
			</div>

			<div class="description detailed hidden">
				<p>Upload success message handle</p>


					<h4>Parameters</h4>
					<div class="list"><dl>
						<dt><var>$message</var></dt>
						<dd>Upload successfully.</dd>
						<dt><var>$return</var></dt>
						<dd>false</dd>
					</dl></div>

					<h4>Returns</h4>
					<div class="list">
						array|string
					</div>




			</div>
			</div></td>
		</tr>
		<tr data-order="error" id="_error">

			<td class="attributes"><code>
				 public 
				array|string
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_error">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#508-518" title="Go to source code">error</a>( <span>string <var>$message</var> = <span class="php-quote">&quot;Upload failed.&quot;</span></span>, <span>boolean <var>$return</var> = <span class="php-keyword1">false</span></span> )</code>

			<div class="description short">
				<p>Upload failed or error message handle</p>
			</div>

			<div class="description detailed hidden">
				<p>Upload failed or error message handle</p>


					<h4>Parameters</h4>
					<div class="list"><dl>
						<dt><var>$message</var></dt>
						<dd>Upload failed.</dd>
						<dt><var>$return</var></dt>
						<dd>false</dd>
					</dl></div>

					<h4>Returns</h4>
					<div class="list">
						array|string
					</div>




			</div>
			</div></td>
		</tr>
		<tr data-order="errorExit" id="_errorExit">

			<td class="attributes"><code>
				 public 
				
				
				</code>
			</td>

			<td class="name"><div>
			<a class="anchor" href="#_errorExit">#</a>
			<code><a href="source-class-Slimore.Upload.Uploader.html#521-529" title="Go to source code">errorExit</a>( )</code>

			<div class="description short">
				<p>Error exit</p>
			</div>

			<div class="description detailed hidden">
				<p>Error exit</p>







			</div>
			</div></td>
		</tr>
			</table>
		</div>











		<div class="panel panel-default">
            <div class="panel-heading"><h2>Properties summary</h2></div>
			<table class="summary table table-bordered table-striped properties" id="properties">
		<tr data-order="files" id="$files">
			<td class="attributes"><code>
				public  
				array
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#25-30" title="Go to source code"><var>$files</var></a>

				<div class="description short">
					<p>$_FILES array</p>
				</div>

				<div class="description detailed hidden">
					<p>$_FILES array</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$files" class="anchor">#</a>
					<code></code>
				</div>
			</td>
		</tr>
		<tr data-order="mode" id="$mode">
			<td class="attributes"><code>
				public  
				integer
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#33-38" title="Go to source code"><var>$mode</var></a>

				<div class="description short">
					<p>Read and write authority mode</p>
				</div>

				<div class="description detailed hidden">
					<p>Read and write authority mode</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$mode" class="anchor">#</a>
					<code><span class="php-num">0755</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="lang" id="$lang">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#40-43" title="Go to source code"><var>$lang</var></a>

				<div class="description short">
					
				</div>

				<div class="description detailed hidden">
					

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$lang" class="anchor">#</a>
					<code><span class="php-quote">'EN'</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="fileExit" id="$fileExit">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#45-50" title="Go to source code"><var>$fileExit</var></a>

				<div class="description short">
					<p>Filename extension</p>
				</div>

				<div class="description detailed hidden">
					<p>Filename extension</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$fileExit" class="anchor">#</a>
					<code></code>
				</div>
			</td>
		</tr>
		<tr data-order="saveName" id="$saveName">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#52-57" title="Go to source code"><var>$saveName</var></a>

				<div class="description short">
					<p>Saved filename</p>
				</div>

				<div class="description detailed hidden">
					<p>Saved filename</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$saveName" class="anchor">#</a>
					<code></code>
				</div>
			</td>
		</tr>
		<tr data-order="saveURL" id="$saveURL">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#59-64" title="Go to source code"><var>$saveURL</var></a>

				<div class="description short">
					<p>Url path Saved to database</p>
				</div>

				<div class="description detailed hidden">
					<p>Url path Saved to database</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$saveURL" class="anchor">#</a>
					<code></code>
				</div>
			</td>
		</tr>
		<tr data-order="savePath" id="$savePath">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#67-72" title="Go to source code"><var>$savePath</var></a>

				<div class="description short">
					<p>Saved the local file path</p>
				</div>

				<div class="description detailed hidden">
					<p>Saved the local file path</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$savePath" class="anchor">#</a>
					<code></code>
				</div>
			</td>
		</tr>
		<tr data-order="message" id="$message">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#74-79" title="Go to source code"><var>$message</var></a>

				<div class="description short">
					<p>Output result message</p>
				</div>

				<div class="description detailed hidden">
					<p>Output result message</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$message" class="anchor">#</a>
					<code></code>
				</div>
			</td>
		</tr>
		<tr data-order="randomLength" id="$randomLength">
			<td class="attributes"><code>
				public  
				string|integer
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#82-89" title="Go to source code"><var>$randomLength</var></a>

				<div class="description short">
					<p>Generate the length of the random file name</p>
				</div>

				<div class="description detailed hidden">
					<p>Generate the length of the random file name</p>

<p>when the date is the date() format</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$randomLength" class="anchor">#</a>
					<code><span class="php-quote">'Ymd'</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="randomNameType" id="$randomNameType">
			<td class="attributes"><code>
				public  
				integer
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#92-101" title="Go to source code"><var>$randomNameType</var></a>

				<div class="description short">
					<p>Generate the random form</p>
				</div>

				<div class="description detailed hidden">
					<p>Generate the random form</p>

<p>NULL to retain the original file name
1 generated random strings
2 generate the date file name</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$randomNameType" class="anchor">#</a>
					<code><span class="php-num">1</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="timezone" id="$timezone">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#104-109" title="Go to source code"><var>$timezone</var></a>

				<div class="description short">
					<p>Timezone</p>
				</div>

				<div class="description detailed hidden">
					<p>Timezone</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$timezone" class="anchor">#</a>
					<code><span class="php-quote">'PRC'</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="formats" id="$formats">
			<td class="attributes"><code>
				public  
				array
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#112-117" title="Go to source code"><var>$formats</var></a>

				<div class="description short">
					<p>Allow Upload file format</p>
				</div>

				<div class="description detailed hidden">
					<p>Allow Upload file format</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$formats" class="anchor">#</a>
					<code>[<span class="php-quote">'gif'</span>, <span class="php-quote">'jpg'</span>, <span class="php-quote">'jpeg'</span>, <span class="php-quote">'png'</span>, <span class="php-quote">'bmp'</span>, <span class="php-quote">'webp'</span>]</code>
				</div>
			</td>
		</tr>
		<tr data-order="maxSize" id="$maxSize">
			<td class="attributes"><code>
				public  
				integer
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#120-125" title="Go to source code"><var>$maxSize</var></a>

				<div class="description short">
					<p>Maximum upload file size, unit KB</p>
				</div>

				<div class="description detailed hidden">
					<p>Maximum upload file size, unit KB</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$maxSize" class="anchor">#</a>
					<code><span class="php-num">1024</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="cover" id="$cover">
			<td class="attributes"><code>
				public  
				boolean
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#127-131" title="Go to source code"><var>$cover</var></a>

				<div class="description short">
					<p>Whether to cover the same name file, true covered, false not covered</p>
				</div>

				<div class="description detailed hidden">
					<p>Whether to cover the same name file, true covered, false not covered</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$cover" class="anchor">#</a>
					<code><span class="php-keyword1">true</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="redirect" id="$redirect">
			<td class="attributes"><code>
				public  
				boolean
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#133-138" title="Go to source code"><var>$redirect</var></a>

				<div class="description short">
					<p>Whether URL redirect</p>
				</div>

				<div class="description detailed hidden">
					<p>Whether URL redirect</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$redirect" class="anchor">#</a>
					<code><span class="php-keyword1">false</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="redirectURL" id="$redirectURL">
			<td class="attributes"><code>
				public  
				string
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#141-146" title="Go to source code"><var>$redirectURL</var></a>

				<div class="description short">
					<p>Redirect url</p>
				</div>

				<div class="description detailed hidden">
					<p>Redirect url</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$redirectURL" class="anchor">#</a>
					<code><span class="php-quote">&quot;&quot;</span></code>
				</div>
			</td>
		</tr>
		<tr data-order="errors" id="$errors">
			<td class="attributes"><code>
				public  
				array
			</code></td>

			<td class="name">
					<a href="source-class-Slimore.Upload.Uploader.html#148-160" title="Go to source code"><var>$errors</var></a>

				<div class="description short">
					<p>Errors message</p>
				</div>

				<div class="description detailed hidden">
					<p>Errors message</p>

				</div>
			</td>
			<td class="value">
				<div>
					<a href="#$errors" class="anchor">#</a>
					<code>[
    <span class="php-quote">'empty'</span>      =&gt; <span class="php-quote">'The upload file can\'t be empty.'</span>,
    <span class="php-quote">'format'</span>     =&gt; <span class="php-quote">'The uploaded file format does not conform to the regulations.'</span>,
    <span class="php-quote">'maxsize'</span>    =&gt; <span class="php-quote">'The upload file size too large.'</span>,
    <span class="php-quote">'unwritable'</span> =&gt; <span class="php-quote">'Save the directory not to write, please change permissions.'</span>,
    <span class="php-quote">'not_exist'</span>  =&gt; <span class="php-quote">'Save the directory not exist.'</span>,
    <span class="php-quote">'same_file'</span>  =&gt; <span class="php-quote">'There are already the same file exist.'</span>
]</code>
				</div>
			</td>
		</tr>
			</table>
		</div>






</div>
	</div>

	<div id="footer">
		Slimore API documentation generated by <a href="http://apigen.org">ApiGen</a>
	</div>
</div>
<script src="resources/combined.js"></script>
<script src="elementlist.js"></script>
</body>
</html>
